<?php
if(!isset($_SESSION)) @session_start();
function tabulate_links ($link_data) {
    
    foreach ($link_data as $key => $url) {
            $i = 0;
            echo "<div class=\"fl links_width\">";
            echo "<h3 class=\"h3linkhead\">{$link_data[$key]["text"]}</h3>";
            echo "<ul>";
            foreach ($link_data[$key]["links"] as $lkey => $link) {
                echo "<li>";
                if (!isset($_SESSION["username"])) echo "<a href=\"{$key}/{$link['url']}\">{$link['text']}</a>";
                else {
                    echo "<div style='border:solid 1px'>";
                    echo "<input id=\"{$key}aaa{$i}aaatext\" value='{$link['text']}' onkeyup=\"footer.links.update('{$key}aaa{$i}');\"><br>";
                    echo "{$key}/<input  id=\"{$key}aaa{$i}aaaurl\" value='{$link['url']}' onkeyup=\"footer.links.update('{$key}aaa{$i}');\">";
                    echo "</div>";
                }
                echo "</li>";
                $i++;
            }
            echo "</ul>";
            
            echo "</div>";
            //$i++;
    }
    if (isset($_SESSION["username"])) echo "<div><button id=btn_save_links style='display:none' onclick=\"footer.links.save()\">Save links</button></div>";
}

function show_accreditation ($accreditation_data, $class) {
    echo "<div class=\"accreditation_footer h_1\">";
    foreach ($accreditation_data as $key => $data) {
            echo "<div class=\"accreditation_link\" ><a href=\"{$data["url"]}\" ><img src=\"{$data["img"]}\" alt=\"{$data["text"]}\" /></a></div>";
    }
		echo "</div>";
}

?>
